package com.acheli.registry.keybind;

import com.acheli.ACHeli;
import com.mojang.blaze3d.platform.InputConstants;
import net.minecraft.client.KeyMapping;
import net.minecraftforge.client.event.RegisterKeyMappingsEvent;
import net.minecraftforge.client.settings.KeyConflictContext;
import org.lwjgl.glfw.GLFW;

public class KeyBinding {
    public static final String KEY_CATEGORY_EXAMPLE = "key.category."+ ACHeli.MODID +".example";
    public static String factoryKeyBuilder (String name) {
        return "key."+ ACHeli.MODID +"."+name;
    }
    public static final KeyMapping CYCLIC_PUSH = new KeyMapping(factoryKeyBuilder("cyclic_push"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_J, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping CYCLIC_PULL = new KeyMapping(factoryKeyBuilder("cyclic_pull"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_N, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping CYCLIC_LEFT = new KeyMapping(factoryKeyBuilder("cyclic_left"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_B, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping CYCLIC_RIGHT = new KeyMapping(factoryKeyBuilder("cyclic_right"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_M, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping COLLECTIVE_UP = new KeyMapping(factoryKeyBuilder("collective_up"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_UP, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping COLLECTIVE_DOWN = new KeyMapping(factoryKeyBuilder("collective_down"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_DOWN, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping RUDDER_LEFT = new KeyMapping(factoryKeyBuilder("collective_left"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_LEFT, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping RUDDER_RIGHT = new KeyMapping(factoryKeyBuilder("collective_right"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_RIGHT, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping ENGINE_BUTTON_RIGHT = new KeyMapping(factoryKeyBuilder("engine_button_right"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_RIGHT_ALT, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping MENU_BUTTON = new KeyMapping(factoryKeyBuilder("menu_button"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_O, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping TEST_X = new KeyMapping(factoryKeyBuilder("test_x"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_INSERT, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping TEST_Y = new KeyMapping(factoryKeyBuilder("test_y"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_HOME, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping TEST_Z = new KeyMapping(factoryKeyBuilder("test_z"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_PAGE_UP, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping TEST_DOWN = new KeyMapping(factoryKeyBuilder("test_down"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_DELETE, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping TEST_UP = new KeyMapping(factoryKeyBuilder("test_up"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_PAGE_DOWN, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping TEST_CHANGE = new KeyMapping(factoryKeyBuilder("test_change"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_END, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping Key_LeftCtrl = new KeyMapping(factoryKeyBuilder("key_left_ctrl"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_LEFT_CONTROL, KEY_CATEGORY_EXAMPLE);
    public static final KeyMapping Key_RightCtrl = new KeyMapping(factoryKeyBuilder("key_right_ctrl"), KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_RIGHT_CONTROL, KEY_CATEGORY_EXAMPLE);
    public static void register(RegisterKeyMappingsEvent event) {
        event.register(KeyBinding.CYCLIC_PUSH);
        event.register(KeyBinding.CYCLIC_PULL);
        event.register(KeyBinding.CYCLIC_LEFT);
        event.register(KeyBinding.CYCLIC_RIGHT);
        event.register(KeyBinding.COLLECTIVE_UP);
        event.register(KeyBinding.COLLECTIVE_DOWN);
        event.register(KeyBinding.RUDDER_LEFT);
        event.register(KeyBinding.RUDDER_RIGHT);
        event.register(KeyBinding.ENGINE_BUTTON_RIGHT);
        event.register(KeyBinding.MENU_BUTTON);
        event.register(KeyBinding.TEST_X);
        event.register(KeyBinding.TEST_Y);
        event.register(KeyBinding.TEST_Z);
        event.register(KeyBinding.TEST_DOWN);
        event.register(KeyBinding.TEST_UP);
        event.register(KeyBinding.TEST_CHANGE);

    }

}
